#include "GameplayView.h"

#include <iostream>

using namespace Views::Console;

void GameplayView::openPickPlayersDialog(Cards::PlayersCards players_cards)
{
	int players_count = 0, i = 1;
	std::cout << "Wpisz liczbe graczy" << std::endl;
	std::cin >> players_count;
	std::queue<std::pair<Cards::PlayerCard*, Players::PLAYER_TYPE>> players;

	for(Cards::PlayersCards::iterator iterator = players_cards.begin(); i <= players_count && iterator != players_cards.end(); ++i, ++iterator)
	{
		std::cout << "Gracz " << i << " - " << static_cast<std::string>((*iterator)->getTitle()) << std::endl;
		players.push(std::make_pair((*iterator), Players::LOCAL));
	}
	playersPickEvent(players);
}

void GameplayView::startTurn(Players::Player* player)
{
	std::cout << "Tura gracza " << static_cast<std::string>(player->getName()) << std::endl;
}

void GameplayView::endTurn(Players::Player*)
{
	std::cout << "Koniec tury" << std::endl;
}

void GameplayView::playerLose(Players::Player* player)
{
	std::cout << "Gracz " << static_cast<std::string>(player->getName()) << " zostal wyeliminowany" << std::endl;
}

void GameplayView::playerWin(Players::Player* player)
{
	std::cout << "Wygral" << static_cast<std::string>(player->getName()) << std::endl;
}

